/*
 * consecutive.c
 * Asif Shahidullah
 *
 * Contains the definition of the is_consecutive_data_point
 * function. Essentially, this just states that the preceeding
 * data point is in a time consecutive manner.
 */

#include "consecutive.h"
#include "list_data.h"

int is_consecutive_data_point (LData before, LData after) {
	/* If the two hours are the same, then we just check for consecutive
	 * minutes. */ 
	if (after->hour == before->hour)
		return ((after->min - before->min == 1));
	/* Incase we have a consecutive minute with an hour change */
	else if ((after->hour - before->hour == 1))
		return ((after->min == 0) && (before->min == 59));
	else
		return 0;
}
